home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / PlasmaClass.java < prev    next >
Text File  |  1998-10-28  |  3KB  |  140 lines

  1. /*
  2.     A basic extension of the java.awt.Frame class
  3.  */
  4.  
  5. import java.awt.*;
  6.  
  7. import symantec.itools.multimedia.*;
  8. import symantec.itools.multimedia.Plasma;
  9. public class PlasmaClass extends Frame
  10. {
  11.     public PlasmaClass()
  12.     {
  13.         // This code is automatically generated by Visual Cafe when you add
  14.         // components to the visual environment. It instantiates and initializes
  15.         // the components. To modify the code, only use code syntax that matches
  16.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  17.         // parse your Java file into its visual environment.
  18.         //{{INIT_CONTROLS
  19.         setLayout(null);
  20.         setBackground(java.awt.Color.cyan);
  21.         setSize(425,282);
  22.         setVisible(false);
  23.         add(plasma1);
  24.         plasma1.setBounds(15,9,401,167);
  25.         button1.setActionCommand("button");
  26.         button1.setLabel("Pause");
  27.         add(button1);
  28.         button1.setBounds(81,211,60,40);
  29.         button2.setActionCommand("button");
  30.         button2.setLabel("Close");
  31.         add(button2);
  32.         button2.setBounds(283,211,60,40);
  33.         button3.setActionCommand("button");
  34.         button3.setLabel("Start");
  35.         add(button3);
  36.         button3.setBounds(182,211,60,40);
  37.         setTitle("Untitled");
  38.         //}}
  39.  
  40.         //{{INIT_MENUS
  41.         //}}
  42.  
  43.         //{{REGISTER_LISTENERS
  44.         SymWindow aSymWindow = new SymWindow();
  45.         this.addWindowListener(aSymWindow);
  46.         SymAction lSymAction = new SymAction();
  47.         button1.addActionListener(lSymAction);
  48.         button3.addActionListener(lSymAction);
  49.         button2.addActionListener(lSymAction);
  50.         //}}
  51.     }
  52.  
  53.     public PlasmaClass(String title)
  54.     {
  55.         this();
  56.         setTitle(title);
  57.     }
  58.  
  59.  
  60.  
  61.  
  62.     // Used for addNotify check.
  63.     boolean fComponentsAdjusted = false;
  64.  
  65.     //{{DECLARE_CONTROLS
  66.     symantec.itools.multimedia.Plasma plasma1 = new symantec.itools.multimedia.Plasma();
  67.     java.awt.Button button1 = new java.awt.Button();
  68.     java.awt.Button button2 = new java.awt.Button();
  69.     java.awt.Button button3 = new java.awt.Button();
  70.     //}}
  71.  
  72.     //{{DECLARE_MENUS
  73.     //}}
  74.  
  75.     class SymWindow extends java.awt.event.WindowAdapter
  76.     {
  77.         public void windowClosing(java.awt.event.WindowEvent event)
  78.         {
  79.             Object object = event.getSource();
  80.             if (object == PlasmaClass.this)
  81.                 Frame1_WindowClosing(event);
  82.         }
  83.     }
  84.     
  85.     void Frame1_WindowClosing(java.awt.event.WindowEvent event)
  86.     {
  87.         //hide();         // hide the Frame
  88.         dispose();
  89.     }
  90.  
  91.     class SymAction implements java.awt.event.ActionListener
  92.     {
  93.         public void actionPerformed(java.awt.event.ActionEvent event)
  94.         {
  95.             Object object = event.getSource();
  96.             if (object == button1)
  97.                 button1_Action(event);
  98.             else if (object == button3)
  99.                 button3_Action(event);
  100.             else if (object == button2)
  101.                 button2_Action(event);
  102.         }
  103.     }
  104.  
  105.     void button1_Action(java.awt.event.ActionEvent event)
  106.     {
  107.         // to do: code goes here.
  108.              
  109.         //{{CONNECTION
  110.         // Stop the plasma animation
  111.         {
  112.             plasma1.stopPlasma();
  113.         }
  114.         //}}
  115.     }
  116.  
  117.     void button3_Action(java.awt.event.ActionEvent event)
  118.     {
  119.         // to do: code goes here.
  120.              
  121.         //{{CONNECTION
  122.         // Start the plasma animation
  123.         {
  124.             plasma1.startPlasma();
  125.         }
  126.         //}}
  127.     }
  128.  
  129.     void button2_Action(java.awt.event.ActionEvent event)
  130.     {
  131.         // to do: code goes here.
  132.              
  133.         //{{CONNECTION
  134.         // Hide the Frame
  135.         setVisible(false);
  136.         dispose();
  137.         //}}
  138.     }
  139. }
  140.